#include "cuda_runtime.h"
#include "cuda.h"

void GetGPUInfo(void)
{
    int deviceCnt = 0;
    cout<<endl;
    cudaGetDeviceCount(&deviceCnt);
    for(int i=0;i<deviceCnt;i++){
        cudaDeviceProp devPro;
        cudaGetDeviceProperties(&devPro,i);
        cout<<"use GPU:"<<i<<endl;
        cout<<"device total memery:"<<devPro.totalGlobalMem<<endl;
        cout<<"number of SM:"<<devPro.multiProcessorCount<<endl;
        cout<<"max thread num per thread block:"<<devPro.maxThreadsPerBlock<<endl;
        cout<<"available regs per thread block:"<<devPro.regsPerBlock<<endl;
        cout<<"max thread num per EM:"<<devPro.maxThreadsPerMultiProcessor<<endl;
        cout<<"max threads per EM / 32:"<<devPro.maxThreadsPerMultiProcessor / 32<<endl;
        cout<<"max dev multi processor:"<<devPro.multiProcessorCount<<endl;
    }
}